package com.cskaoyan._05oop2._05inherit;

/**
 * @author Macro_Ray
 * @since 2024/3/13 14:31
 */
public class Demo1 {
    public static void main(String[] args) {
        Husky husky = new Husky();
        husky.eat();
        husky.drink();
        husky.lookHome();
        husky.demolition();
        System.out.println("----------");
        SharPei sharPei = new SharPei();
        sharPei.eat();
        System.out.println("----------");
        ChineseDog chineseDog = new ChineseDog();
        chineseDog.eat();
    }
}
class Dog{
    public void eat(){
        System.out.println("狗在吃狗粮");
    }
    public void drink(){
        System.out.println("狗在喝水");
    }
    public void lookHome(){
        System.out.println("狗在看家");
    }
}
class Husky extends Dog{
    public void demolition(){
        System.out.println("哈士奇又在拆家");
    }

}
class SharPei extends Dog{
    @Override
    public void eat() {
        super.eat();
        System.out.println("哈皮狗啃骨头");
    }
}
class ChineseDog extends Dog{
    @Override
    public void eat() {
        System.out.println("中华田园犬在吃剩饭");
    }
}
